package com.tourism.service.impl;

import com.tourism.dao.CarouselPictureDao;
import com.tourism.entity.CarouselPicture;
import com.tourism.service.CarouselPictureService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description
 * @Author z
 * @Date 2021-04-28 23:41
 */
@Service
public class CarouselPictureServiceImpl implements CarouselPictureService {

    @Autowired
    private CarouselPictureDao carouselPictureDao;

    @Override
    public boolean addCarouselPicture(CarouselPicture carouselPicture) {
        carouselPicture.init();
        return carouselPictureDao.addCarouselPicture(carouselPicture);
    }

    @Override
    public boolean updateCarouselPicture(CarouselPicture carouselPicture) {
        return carouselPictureDao.updateCarouselPicture(carouselPicture);
    }

    @Override
    public List<CarouselPicture> getAllCarouselPicture(String title) {
        return carouselPictureDao.getAllCarouselPicture(title);
    }

    @Override
    public CarouselPicture getCarousePictureById(Long id) {
        return carouselPictureDao.getCarousePictureById(id);
    }
//根据id删除轮播图
    @Override
    public Boolean deleteCarousePictureById(Long id) {
        return carouselPictureDao.deleteCarousePictureById(id);
    }
}
